package com.emperor.inventory.app;

import java.util.Map;

import org.apache.log4j.Logger;

import com.emperor.core.app.App;
import com.emperor.core.app.AppConstant;
import com.emperor.core.app.AppCtrl;

public class InventoryAppCtrl implements AppCtrl {

	public static final String INVENTORY_CTRL = "inventory.ctrl";
	public static final String INVENTORY_ENQ = "inventory.enq";
	public static final String INVENTORY_MSG = "inventory.msg";
	
	public static Logger log = Logger.getLogger(InventoryAppCtrl.class); 
	
	public void doProcess(Map<String, Object> params) {
		App app = null;
		if (params == null) {
			log.error("Param is null");
		} else if (params.get(AppConstant.ACTION).equals(INVENTORY_ENQ)) {
			app = new InventoryAppEnq(params);
		}
		
		if (app != null) {
			app.open();
		}
	}

}
